﻿namespace HRM.CORE.Process
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using APP.HELPER;
    using Common.Report;
    using HRM.CORE;
    using Extra;
    using HRM.CORE.REPORT;
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Common;
    using APP.HELPER.Utils.Language;
    using Security.ERP;
    using Extra.ERP;

    public class xucDisciplineAdd : Common.xucBaseAddH
    {
        private SimpleButton btnPrint;
        private TextEdit cboDecideNumber;
        private TextEdit cboPerson;
        private GridColumn colEmployeeCode;
        private GridColumn colFirstName;
        private GridColumn colLastName;
        private IContainer components = null;
        private DateEdit dtDate;
        private DateEdit dtDateOccurred;
        private GridLookUpEdit glkEmployeeCode;
        private GridView gridLookUpEdit1View;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private GroupControl groupControl1;
        private GroupControl groupControl2;
        private LabelControl labelControl1;
        private LabelControl labelControl12;
        private LabelControl labelControl14;
        private LabelControl labelControl7;
        private LabelControl lcDate;
        private LabelControl lcDateOccurred;
        private LabelControl lcDecideNumber;
        private LabelControl lcDecidePerson;
        private LabelControl lcDescription;
        private LabelControl lcDisciplineName;
        private LabelControl lcForm;
        private LabelControl lcLocation;
        private LabelControl lcNote;
        private LabelControl lcReason;
        private LabelControl lcWitnesses;
        private Guid m_DisciplineID = Guid.Empty;
        private string m_EmployeeCode = "";
        private RadioButton rdNo;
        private RadioButton rdNoKL;
        private RadioButton rdYes;
        private RadioButton rdYesKL;
        private XtraTabPage tabDescription;
        private XtraTabPage tabDisciplineForm;
        private MemoEdit txtDescription;
        private TextEdit txtDisciplineName;
        private TextEdit txtEmployeeName;
        private ButtonEdit txtFilePath;
        private MemoEdit txtForm;
        private TextEdit txtLocation;
        private MemoEdit txtNotes;
        private MemoEdit txtReason;
        private TextEdit txtWitnesses;
        private XtraTabControl xtraTabControl1;

        public event SuccessEventHander Success;

        public xucDisciplineAdd()
        {
            this.InitializeComponent();
            this.InitComponent();
            this.InitData();
        }

        protected override void Add()
        {
            base.Add();
            HRM_PROCESS_DISCIPLINE hrm_process_discipline = new HRM_PROCESS_DISCIPLINE();
            this.txtDisciplineName.Focus();
        }

        private void bnt_In_Click(object sender, EventArgs e)
        {
            xfmReport report = new xfmReport("B\x00e1o C\x00e1o Kỷ Luật");
            rptDisciplineByEmployee xtraReport = new rptDisciplineByEmployee(this.m_DisciplineID, this.m_EmployeeCode);
            report.SetTitle("B\x00e1o c\x00e1o kỷ luật");
            report.ShowPrintPreview(xtraReport);
        }

        public void Clear()
        {
            this.txtDisciplineName.Text = "";
            this.txtReason.Text = "";
            this.txtForm.Text = "";
            this.txtLocation.Text = "";
            this.txtDescription.Text = "";
            this.txtWitnesses.Text = "";
            this.txtNotes.Text = "";
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void glkEmployeeCode_EditValueChanged(object sender, EventArgs e)
        {
            this.m_EmployeeCode = this.glkEmployeeCode.EditValue.ToString();
            this.LoadEmployeeInformation();
        }

        protected override void Init()
        {
        }

        private void InitComponent()
        {
            this.dtDate.DateTime = DateTime.Now;
            this.dtDateOccurred.DateTime = DateTime.Now;
        }

        private void InitData()
        {
            new HRM_EMPLOYEE().AddGridLookupEdit(this.glkEmployeeCode);
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(HRM.CORE.Process.xucDisciplineAdd));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            this.xtraTabControl1 = new XtraTabControl();
            this.tabDescription = new XtraTabPage();
            this.groupControl2 = new GroupControl();
            this.labelControl1 = new LabelControl();
            this.txtEmployeeName = new TextEdit();
            this.glkEmployeeCode = new GridLookUpEdit();
            this.gridLookUpEdit1View = new GridView();
            this.colEmployeeCode = new GridColumn();
            this.colFirstName = new GridColumn();
            this.colLastName = new GridColumn();
            this.lcDisciplineName = new LabelControl();
            this.txtDisciplineName = new TextEdit();
            this.groupBox1 = new GroupBox();
            this.rdNo = new RadioButton();
            this.rdYes = new RadioButton();
            this.dtDateOccurred = new DateEdit();
            this.txtWitnesses = new TextEdit();
            this.txtLocation = new TextEdit();
            this.lcNote = new LabelControl();
            this.labelControl12 = new LabelControl();
            this.lcWitnesses = new LabelControl();
            this.lcDescription = new LabelControl();
            this.lcLocation = new LabelControl();
            this.lcDateOccurred = new LabelControl();
            this.txtNotes = new MemoEdit();
            this.txtDescription = new MemoEdit();
            this.tabDisciplineForm = new XtraTabPage();
            this.groupControl1 = new GroupControl();
            this.groupBox2 = new GroupBox();
            this.rdNoKL = new RadioButton();
            this.rdYesKL = new RadioButton();
            this.lcReason = new LabelControl();
            this.lcForm = new LabelControl();
            this.labelControl14 = new LabelControl();
            this.dtDate = new DateEdit();
            this.txtFilePath = new ButtonEdit();
            this.lcDecideNumber = new LabelControl();
            this.lcDate = new LabelControl();
            this.labelControl7 = new LabelControl();
            this.lcDecidePerson = new LabelControl();
            this.txtForm = new MemoEdit();
            this.txtReason = new MemoEdit();
            this.cboDecideNumber = new TextEdit();
            this.cboPerson = new TextEdit();
            this.btnPrint = new SimpleButton();
            ((ISupportInitialize) base.Err).BeginInit();
            base.imageCollection2.BeginInit();
            this.xtraTabControl1.BeginInit();
            this.xtraTabControl1.SuspendLayout();
            this.tabDescription.SuspendLayout();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            this.txtEmployeeName.Properties.BeginInit();
            this.glkEmployeeCode.Properties.BeginInit();
            this.gridLookUpEdit1View.BeginInit();
            this.txtDisciplineName.Properties.BeginInit();
            this.groupBox1.SuspendLayout();
            this.dtDateOccurred.Properties.VistaTimeProperties.BeginInit();
            this.dtDateOccurred.Properties.BeginInit();
            this.txtWitnesses.Properties.BeginInit();
            this.txtLocation.Properties.BeginInit();
            this.txtNotes.Properties.BeginInit();
            this.txtDescription.Properties.BeginInit();
            this.tabDisciplineForm.SuspendLayout();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.dtDate.Properties.VistaTimeProperties.BeginInit();
            this.dtDate.Properties.BeginInit();
            this.txtFilePath.Properties.BeginInit();
            this.txtForm.Properties.BeginInit();
            this.txtReason.Properties.BeginInit();
            this.cboDecideNumber.Properties.BeginInit();
            this.cboPerson.Properties.BeginInit();
            base.SuspendLayout();
            base.btnSave.Location = new Point(0x10c, 0x145);
            base.btnSave.TabIndex = 2;
            base.btnCancel.Location = new Point(0x1d3, 0x145);
            base.btnCancel.TabIndex = 4;
            base.btnSaveNew.Location = new Point(0x16e, 0x145);
            base.btnSaveNew.TabIndex = 3;
            base.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.xtraTabControl1.BorderStyle = BorderStyles.NoBorder;
            this.xtraTabControl1.Location = new Point(3, 3);
            this.xtraTabControl1.Name = "xtraTabControl1";
            this.xtraTabControl1.SelectedTabPage = this.tabDescription;
            this.xtraTabControl1.Size = new Size(0x23c, 0x13b);
            this.xtraTabControl1.TabIndex = 0;
            this.xtraTabControl1.TabPages.AddRange(new XtraTabPage[] { this.tabDescription, this.tabDisciplineForm });
            this.tabDescription.Controls.Add(this.groupControl2);
            this.tabDescription.Name = "tabDescription";
            this.tabDescription.Size = new Size(0x235, 0x11e);
            this.tabDescription.Text = "M\x00f4 tả sự việc";
            this.groupControl2.BorderStyle = BorderStyles.NoBorder;
            this.groupControl2.Controls.Add(this.labelControl1);
            this.groupControl2.Controls.Add(this.txtEmployeeName);
            this.groupControl2.Controls.Add(this.glkEmployeeCode);
            this.groupControl2.Controls.Add(this.lcDisciplineName);
            this.groupControl2.Controls.Add(this.txtDisciplineName);
            this.groupControl2.Controls.Add(this.groupBox1);
            this.groupControl2.Controls.Add(this.dtDateOccurred);
            this.groupControl2.Controls.Add(this.txtWitnesses);
            this.groupControl2.Controls.Add(this.txtLocation);
            this.groupControl2.Controls.Add(this.lcNote);
            this.groupControl2.Controls.Add(this.labelControl12);
            this.groupControl2.Controls.Add(this.lcWitnesses);
            this.groupControl2.Controls.Add(this.lcDescription);
            this.groupControl2.Controls.Add(this.lcLocation);
            this.groupControl2.Controls.Add(this.lcDateOccurred);
            this.groupControl2.Controls.Add(this.txtNotes);
            this.groupControl2.Controls.Add(this.txtDescription);
            this.groupControl2.Dock = DockStyle.Fill;
            this.groupControl2.Location = new Point(0, 0);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(0x235, 0x11e);
            this.groupControl2.TabIndex = 0;
            this.groupControl2.Text = "Th\x00f4ng Tin Sự Việc";
            this.labelControl1.AllowHtmlString = true;
            this.labelControl1.Location = new Point(10, 12);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x60, 14);
            this.labelControl1.TabIndex = 0;
            this.labelControl1.Text = "Chọn nh\x00e2n vi\x00ean <color=red>(*)</color>:";
            this.txtEmployeeName.Enabled = false;
            this.txtEmployeeName.Location = new Point(0x100, 9);
            this.txtEmployeeName.Name = "txtEmployeeName";
            this.txtEmployeeName.Size = new Size(0x12d, 20);
            this.txtEmployeeName.TabIndex = 2;
            this.glkEmployeeCode.Location = new Point(140, 9);
            this.glkEmployeeCode.Name = "glkEmployeeCode";
            this.glkEmployeeCode.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.glkEmployeeCode.Properties.NullText = "[Chọn nh\x00e2n vi\x00ean]";
            this.glkEmployeeCode.Properties.View = this.gridLookUpEdit1View;
            this.glkEmployeeCode.Size = new Size(110, 20);
            this.glkEmployeeCode.TabIndex = 1;
            this.glkEmployeeCode.EditValueChanged += new EventHandler(this.glkEmployeeCode_EditValueChanged);
            this.gridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.colEmployeeCode, this.colFirstName, this.colLastName });
            this.gridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit1View.Name = "gridLookUpEdit1View";
            this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit1View.OptionsView.ShowAutoFilterRow = true;
            this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.colEmployeeCode.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.colEmployeeCode.FieldName = "EmployeeCode";
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.Visible = true;
            this.colEmployeeCode.VisibleIndex = 0;
            this.colFirstName.Caption = "Họ l\x00f3t";
            this.colFirstName.FieldName = "FirstName";
            this.colFirstName.Name = "colFirstName";
            this.colFirstName.Visible = true;
            this.colFirstName.VisibleIndex = 1;
            this.colLastName.Caption = "T\x00ean";
            this.colLastName.FieldName = "LastName";
            this.colLastName.Name = "colLastName";
            this.colLastName.Visible = true;
            this.colLastName.VisibleIndex = 2;
            this.lcDisciplineName.Location = new Point(10, 0x26);
            this.lcDisciplineName.Name = "lcDisciplineName";
            this.lcDisciplineName.Size = new Size(0x6f, 13);
            this.lcDisciplineName.TabIndex = 3;
            this.lcDisciplineName.Text = "Bị xử l\x00fd kỷ luật về việc:";
            this.txtDisciplineName.Location = new Point(140, 0x24);
            this.txtDisciplineName.Name = "txtDisciplineName";
            this.txtDisciplineName.Size = new Size(0xde, 20);
            this.txtDisciplineName.TabIndex = 4;
            this.groupBox1.Controls.Add(this.rdNo);
            this.groupBox1.Controls.Add(this.rdYes);
            this.groupBox1.Location = new Point(0x12e, 0xab);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x100, 0x24);
            this.groupBox1.TabIndex = 14;
            this.groupBox1.TabStop = false;
            this.rdNo.AutoSize = true;
            this.rdNo.Location = new Point(0x7a, 12);
            this.rdNo.Name = "rdNo";
            this.rdNo.Size = new Size(0x37, 0x11);
            this.rdNo.TabIndex = 1;
            this.rdNo.Text = "Kh\x00f4ng";
            this.rdNo.UseVisualStyleBackColor = true;
            this.rdYes.AutoSize = true;
            this.rdYes.Checked = true;
            this.rdYes.Location = new Point(0x18, 13);
            this.rdYes.Name = "rdYes";
            this.rdYes.Size = new Size(0x26, 0x11);
            this.rdYes.TabIndex = 0;
            this.rdYes.TabStop = true;
            this.rdYes.Text = "C\x00f3";
            this.rdYes.UseVisualStyleBackColor = true;
            this.dtDateOccurred.EditValue = null;
            this.dtDateOccurred.Location = new Point(0x1c7, 0x25);
            this.dtDateOccurred.Name = "dtDateOccurred";
            this.dtDateOccurred.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtDateOccurred.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtDateOccurred.Size = new Size(0x66, 20);
            this.dtDateOccurred.TabIndex = 6;
            this.txtWitnesses.Location = new Point(140, 0x95);
            this.txtWitnesses.Name = "txtWitnesses";
            this.txtWitnesses.Size = new Size(0x1a1, 20);
            this.txtWitnesses.TabIndex = 12;
            this.txtLocation.Location = new Point(140, 0x3f);
            this.txtLocation.Name = "txtLocation";
            this.txtLocation.Size = new Size(0x1a1, 20);
            this.txtLocation.TabIndex = 8;
            this.lcNote.Location = new Point(10, 0xd1);
            this.lcNote.Name = "lcNote";
            this.lcNote.Size = new Size(0x171, 13);
            this.lcNote.TabIndex = 15;
            this.lcNote.Text = "Nếu c\x00f3, n\x00eau r\x00f5 sự việc n\x00e0y vi phạm ch\x00ednh s\x00e1ch n\x00e0o v\x00e0 những vi phạm cụ thể.";
            this.labelControl12.Location = new Point(10, 0xb9);
            this.labelControl12.Name = "labelControl12";
            this.labelControl12.Size = new Size(0x116, 13);
            this.labelControl12.TabIndex = 13;
            this.labelControl12.Text = "Sự vệc n\x00e0y c\x00f3 vi phạm ch\x00ednh s\x00e1ch của c\x00f4ng ty hay kh\x00f4ng?";
            this.lcWitnesses.Location = new Point(10, 0x98);
            this.lcWitnesses.Name = "lcWitnesses";
            this.lcWitnesses.Size = new Size(0x79, 13);
            this.lcWitnesses.TabIndex = 11;
            this.lcWitnesses.Text = "Những người chứng kiến:";
            this.lcDescription.Location = new Point(10, 0x5c);
            this.lcDescription.Name = "lcDescription";
            this.lcDescription.Size = new Size(0x73, 13);
            this.lcDescription.TabIndex = 9;
            this.lcDescription.Text = "M\x00f4 tả lại sự việc xảy ra:";
            this.lcLocation.Location = new Point(10, 0x42);
            this.lcLocation.Name = "lcLocation";
            this.lcLocation.Size = new Size(0x74, 13);
            this.lcLocation.TabIndex = 7;
            this.lcLocation.Text = "Địa điểm xảy ra sự việc:";
            this.lcDateOccurred.Location = new Point(370, 0x27);
            this.lcDateOccurred.Name = "lcDateOccurred";
            this.lcDateOccurred.Size = new Size(0x51, 13);
            this.lcDateOccurred.TabIndex = 5;
            this.lcDateOccurred.Text = "Thời gian xảy ra:";
            this.txtNotes.Location = new Point(8, 0xe4);
            this.txtNotes.Name = "txtNotes";
            this.txtNotes.Properties.Appearance.Options.UseTextOptions = true;
            this.txtNotes.Properties.Appearance.TextOptions.WordWrap = WordWrap.Wrap;
            this.txtNotes.Size = new Size(0x225, 0x33);
            this.txtNotes.TabIndex = 0x10;
            this.txtDescription.Location = new Point(140, 0x59);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new Size(0x1a1, 0x34);
            this.txtDescription.TabIndex = 10;
            this.tabDisciplineForm.Controls.Add(this.groupControl1);
            this.tabDisciplineForm.Name = "tabDisciplineForm";
            this.tabDisciplineForm.Size = new Size(0x235, 0x11e);
            this.tabDisciplineForm.Text = "H\x00ecnh thức kỷ luật";
            this.groupControl1.BorderStyle = BorderStyles.NoBorder;
            this.groupControl1.Controls.Add(this.groupBox2);
            this.groupControl1.Controls.Add(this.lcReason);
            this.groupControl1.Controls.Add(this.lcForm);
            this.groupControl1.Controls.Add(this.labelControl14);
            this.groupControl1.Controls.Add(this.dtDate);
            this.groupControl1.Controls.Add(this.txtFilePath);
            this.groupControl1.Controls.Add(this.lcDecideNumber);
            this.groupControl1.Controls.Add(this.lcDate);
            this.groupControl1.Controls.Add(this.labelControl7);
            this.groupControl1.Controls.Add(this.lcDecidePerson);
            this.groupControl1.Controls.Add(this.txtForm);
            this.groupControl1.Controls.Add(this.txtReason);
            this.groupControl1.Controls.Add(this.cboDecideNumber);
            this.groupControl1.Controls.Add(this.cboPerson);
            this.groupControl1.Dock = DockStyle.Fill;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x235, 0x11e);
            this.groupControl1.TabIndex = 0;
            this.groupControl1.Text = "Th\x00f4ng Tin Kỷ Luật";
            this.groupBox2.Controls.Add(this.rdNoKL);
            this.groupBox2.Controls.Add(this.rdYesKL);
            this.groupBox2.Location = new Point(0x161, 0x5e);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new Size(0xca, 0x24);
            this.groupBox2.TabIndex = 4;
            this.groupBox2.TabStop = false;
            this.rdNoKL.AutoSize = true;
            this.rdNoKL.Location = new Point(0x72, 13);
            this.rdNoKL.Name = "rdNoKL";
            this.rdNoKL.Size = new Size(0x37, 0x11);
            this.rdNoKL.TabIndex = 1;
            this.rdNoKL.Text = "Kh\x00f4ng";
            this.rdNoKL.UseVisualStyleBackColor = true;
            this.rdYesKL.AutoSize = true;
            this.rdYesKL.Checked = true;
            this.rdYesKL.Location = new Point(0x17, 13);
            this.rdYesKL.Name = "rdYesKL";
            this.rdYesKL.Size = new Size(0x26, 0x11);
            this.rdYesKL.TabIndex = 0;
            this.rdYesKL.TabStop = true;
            this.rdYesKL.Text = "C\x00f3";
            this.rdYesKL.UseVisualStyleBackColor = true;
            this.lcReason.Location = new Point(10, 130);
            this.lcReason.Name = "lcReason";
            this.lcReason.Size = new Size(0x135, 13);
            this.lcReason.TabIndex = 5;
            this.lcReason.Text = "Người lao động c\x00f3 giải th\x00edch g\x00ec khi xảy ra sự việc? Nếu c\x00f3, ghi r\x00f5?";
            this.lcForm.Location = new Point(9, 8);
            this.lcForm.Name = "lcForm";
            this.lcForm.Size = new Size(270, 13);
            this.lcForm.TabIndex = 1;
            this.lcForm.Text = "H\x00ecnh thức kỷ luật n\x00e0o được \x00e1p dụng cho người lao động?";
            this.labelControl14.Location = new Point(11, 0x6c);
            this.labelControl14.Name = "labelControl14";
            this.labelControl14.Size = new Size(0x14d, 13);
            this.labelControl14.TabIndex = 3;
            this.labelControl14.Text = "Đ\x00e3 giải th\x00edch c\x00e1c h\x00e0nh động vi phạm của người lao động cho họ chưa?";
            this.dtDate.EditValue = null;
            this.dtDate.Location = new Point(0x1cf, 0xe0);
            this.dtDate.Name = "dtDate";
            this.dtDate.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtDate.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtDate.Size = new Size(0x5d, 20);
            this.dtDate.TabIndex = 12;
            this.txtFilePath.Location = new Point(0x57, 0xfe);
            this.txtFilePath.Name = "txtFilePath";
            this.txtFilePath.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Glyph, "", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("txtFilePath.Properties.Buttons"), new KeyShortcut(Keys.None), appearance, "", "Browse", null, true) });
            this.txtFilePath.Properties.ButtonClick += new ButtonPressedEventHandler(this.txtFilePath_Properties_ButtonClick);
            this.txtFilePath.Size = new Size(0x1d5, 0x16);
            this.txtFilePath.TabIndex = 0;
            this.txtFilePath.Visible = false;
            this.lcDecideNumber.Location = new Point(12, 0xe3);
            this.lcDecideNumber.Name = "lcDecideNumber";
            this.lcDecideNumber.Size = new Size(70, 13);
            this.lcDecideNumber.TabIndex = 7;
            this.lcDecideNumber.Text = "Số quyết định:";
            this.lcDate.Location = new Point(0x1ac, 0xe3);
            this.lcDate.Name = "lcDate";
            this.lcDate.Size = new Size(0x1d, 13);
            this.lcDate.TabIndex = 11;
            this.lcDate.Text = "Ng\x00e0y:";
            this.labelControl7.Location = new Point(12, 0x102);
            this.labelControl7.Name = "labelControl7";
            this.labelControl7.Size = new Size(0x25, 13);
            this.labelControl7.TabIndex = 13;
            this.labelControl7.Text = "Tập tin:";
            this.labelControl7.Visible = false;
            this.lcDecidePerson.Location = new Point(190, 0xe3);
            this.lcDecidePerson.Name = "lcDecidePerson";
            this.lcDecidePerson.Size = new Size(80, 13);
            this.lcDecidePerson.TabIndex = 9;
            this.lcDecidePerson.Text = "Người ban h\x00e0nh:";
            this.txtForm.Location = new Point(8, 0x1b);
            this.txtForm.Name = "txtForm";
            this.txtForm.Size = new Size(0x223, 0x3d);
            this.txtForm.TabIndex = 2;
            this.txtReason.Location = new Point(8, 0x95);
            this.txtReason.Name = "txtReason";
            this.txtReason.Size = new Size(0x223, 0x40);
            this.txtReason.TabIndex = 6;
            this.cboDecideNumber.Location = new Point(0x57, 0xe0);
            this.cboDecideNumber.Name = "cboDecideNumber";
            this.cboDecideNumber.Size = new Size(0x61, 20);
            this.cboDecideNumber.TabIndex = 8;
            this.cboPerson.Location = new Point(0x110, 0xe0);
            this.cboPerson.Name = "cboPerson";
            this.cboPerson.Size = new Size(150, 20);
            this.cboPerson.TabIndex = 10;
            this.btnPrint.Image = MsgResc.print16x16;
            this.btnPrint.ImageList = base.imageCollection2;
            this.btnPrint.Location = new Point(12, 0x145);
            this.btnPrint.Name = "btnPrint";
            this.btnPrint.Size = new Size(0x92, 0x1b);
            this.btnPrint.TabIndex = 1;
            this.btnPrint.Text = "In Phiếu";
            this.btnPrint.Click += new EventHandler(this.bnt_In_Click);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.btnPrint);
            base.Controls.Add(this.xtraTabControl1);
            base.Name = "xucDisciplineAdd";
            base.Size = new Size(0x23e, 360);
            base.Controls.SetChildIndex(base.btnCancel, 0);
            base.Controls.SetChildIndex(base.btnSave, 0);
            base.Controls.SetChildIndex(base.btnSaveNew, 0);
            base.Controls.SetChildIndex(this.xtraTabControl1, 0);
            base.Controls.SetChildIndex(this.btnPrint, 0);
            ((ISupportInitialize) base.Err).EndInit();
            base.imageCollection2.EndInit();
            this.xtraTabControl1.EndInit();
            this.xtraTabControl1.ResumeLayout(false);
            this.tabDescription.ResumeLayout(false);
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.groupControl2.PerformLayout();
            this.txtEmployeeName.Properties.EndInit();
            this.glkEmployeeCode.Properties.EndInit();
            this.gridLookUpEdit1View.EndInit();
            this.txtDisciplineName.Properties.EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.dtDateOccurred.Properties.VistaTimeProperties.EndInit();
            this.dtDateOccurred.Properties.EndInit();
            this.txtWitnesses.Properties.EndInit();
            this.txtLocation.Properties.EndInit();
            this.txtNotes.Properties.EndInit();
            this.txtDescription.Properties.EndInit();
            this.tabDisciplineForm.ResumeLayout(false);
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.groupControl1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.dtDate.Properties.VistaTimeProperties.EndInit();
            this.dtDate.Properties.EndInit();
            this.txtFilePath.Properties.EndInit();
            this.txtForm.Properties.EndInit();
            this.txtReason.Properties.EndInit();
            this.cboDecideNumber.Properties.EndInit();
            this.cboPerson.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void InitMultiLanguages()
        {
            this.tabDescription.Text = MultiLanguages.GetString("tbl_ProcessDisciplineAdd", "tabDescription", this.tabDescription.Text);
            this.tabDisciplineForm.Text = MultiLanguages.GetString("tbl_ProcessDisciplineAdd", "tabDisciplineForm", this.tabDisciplineForm.Text);
            this.btnPrint.Text = MultiLanguages.GetString("tbl_ProcessDisciplineAdd", "Print", this.btnPrint.Text);
            this.lcDisciplineName.Text = MultiLanguages.GetString("tbl_ProcessDisciplineAdd", "DisciplineName", this.lcDisciplineName.Text);
            this.lcDateOccurred.Text = MultiLanguages.GetString("tbl_ProcessDisciplineAdd", "DateOccurred", this.lcDateOccurred.Text);
            this.lcLocation.Text = MultiLanguages.GetString("tbl_ProcessDisciplineAdd", "Location", this.lcLocation.Text);
            this.lcDescription.Text = MultiLanguages.GetString("tbl_ProcessDisciplineAdd", "Description", this.lcDescription.Text);
        }

        private void LoadEmployeeInformation()
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.m_EmployeeCode);
            this.groupControl1.Text = this.groupControl1.Text + " - " + hrm_employee.EmployeeCode + " (" + hrm_employee.FirstName + " " + hrm_employee.LastName + ")";
            this.txtEmployeeName.Text = hrm_employee.FirstName + " " + hrm_employee.LastName;
        }

        private void RaiseSuccessEventHander(HRM_PROCESS_DISCIPLINE item)
        {
            if (this.Success != null)
            {
                this.Success(this, item);
            }
        }

        public void SetCode(string EmployeeCode)
        {
            this.m_EmployeeCode = EmployeeCode;
            if (this.m_EmployeeCode != "")
            {
                this.glkEmployeeCode.EditValue = this.m_EmployeeCode;
                this.LoadEmployeeInformation();
            }
        }

        public void SetData(HRM_PROCESS_DISCIPLINE item)
        {
            this.m_DisciplineID = item.DisciplineID;
            SYS_LOG.Insert("Qu\x00e1 Tr\x00ecnh Kỷ Luật", "Xem", this.m_DisciplineID.ToString());
            this.m_EmployeeCode = item.EmployeeCode;
            this.glkEmployeeCode.EditValue = this.m_EmployeeCode;
            this.glkEmployeeCode.Enabled = false;
            this.txtDisciplineName.Text = item.DisciplineName;
            this.txtReason.Text = item.Reason;
            this.txtForm.Text = item.Form;
            this.cboDecideNumber.Text = item.DecideNumber;
            this.dtDate.DateTime = item.Date;
            this.cboPerson.Text = item.Person;
            this.txtFilePath.Text = item.FilePath;
            this.dtDateOccurred.DateTime = item.DateOccurred;
            this.txtLocation.Text = item.Location;
            this.txtDescription.Text = item.Description;
            this.txtWitnesses.Text = item.Witnesses;
            if (item.Violations.ToString() == "True")
            {
                this.rdYes.Checked = true;
            }
            else
            {
                this.rdNo.Checked = true;
            }
            this.txtNotes.Text = item.Notes;
            if (item.Settlement.ToString() == "True")
            {
                this.rdYesKL.Checked = true;
            }
            else
            {
                this.rdNoKL.Checked = true;
            }
            this.LoadEmployeeInformation();
        }

        private void txtFilePath_Properties_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog {
                Filter = "All File(*.*)|*.*",
                FilterIndex = 0
            };
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                this.txtFilePath.Text = dialog.FileName;
            }
        }

        protected override string uc_Change()
        {
            return string.Empty;
        }

        protected override string uc_Delete()
        {
            HRM_PROCESS_DISCIPLINE item = new HRM_PROCESS_DISCIPLINE {
                DisciplineID = this.m_DisciplineID
            };
            string str = item.Delete();
            if (str == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            return str;
        }

        protected override string uc_Save()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiProcessDiscipline") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowAdd)
            {
                MyRule.Notify();
                return "";
            }
            if (this.m_EmployeeCode == "")
            {
                XtraMessageBox.Show("Vui l\x00f2ng chọn nh\x00e2n vi\x00ean để lưu dữ liệu!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK);
                return "";
            }
            SYS_LOG.Insert("Qu\x00e1 Tr\x00ecnh Kỷ Luật", "Th\x00eam", this.m_DisciplineID.ToString());
            base.SetWaitDialogCaption("Đang lưu dữ liệu...");
            Cursor.Current = Cursors.WaitCursor;
            HRM_PROCESS_DISCIPLINE item = new HRM_PROCESS_DISCIPLINE {
                DisciplineID = Guid.NewGuid(),
                EmployeeCode = this.m_EmployeeCode
            };
            this.glkEmployeeCode.EditValue = this.m_EmployeeCode;
            this.glkEmployeeCode.Enabled = false;
            item.DisciplineName = this.txtDisciplineName.Text;
            item.Reason = this.txtReason.Text;
            item.Form = this.txtForm.Text;
            item.Date = this.dtDate.DateTime;
            item.DecideNumber = this.cboDecideNumber.Text;
            item.Person = this.cboPerson.Text;
            item.FilePath = this.txtFilePath.Text;
            item.DateOccurred = this.dtDateOccurred.DateTime;
            item.Location = this.txtLocation.Text;
            item.Description = this.txtDescription.Text;
            item.Witnesses = this.txtWitnesses.Text;
            if (this.rdYes.Checked)
            {
                item.Violations = true;
            }
            else
            {
                item.Violations = false;
            }
            item.Notes = this.txtNotes.Text;
            if (this.rdYesKL.Checked)
            {
                item.Settlement = true;
            }
            else
            {
                item.Settlement = false;
            }
            string text = item.Insert();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            Cursor.Current = Cursors.Default;
            this.DoHide();
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            return text;
        }

        protected override string uc_Update()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiProcessDiscipline") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowEdit)
            {
                MyRule.Notify();
                return "";
            }
            SYS_LOG.Insert("Qu\x00e1 Tr\x00ecnh Kỷ Luật", "Cập Nhật", this.m_DisciplineID.ToString());
            base.SetWaitDialogCaption("Đang cập nhật dữ liệu...");
            HRM_PROCESS_DISCIPLINE item = new HRM_PROCESS_DISCIPLINE {
                DisciplineID = this.m_DisciplineID,
                EmployeeCode = this.m_EmployeeCode,
                DisciplineName = this.txtDisciplineName.Text,
                Reason = this.txtReason.Text,
                Form = this.txtForm.Text,
                Date = this.dtDate.DateTime,
                DecideNumber = this.cboDecideNumber.Text,
                Person = this.cboPerson.Text,
                FilePath = this.txtFilePath.Text,
                DateOccurred = this.dtDateOccurred.DateTime,
                Location = this.txtLocation.Text,
                Description = this.txtDescription.Text,
                Witnesses = this.txtWitnesses.Text
            };
            if (this.rdYes.Checked)
            {
                item.Violations = true;
            }
            else
            {
                item.Violations = false;
            }
            item.Notes = this.txtNotes.Text;
            if (this.rdYesKL.Checked)
            {
                item.Settlement = true;
            }
            else
            {
                item.Settlement = false;
            }
            string text = item.Update();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            this.DoHide();
            return text;
        }

        public delegate void SuccessEventHander(object sender, HRM_PROCESS_DISCIPLINE item);
    }
}

